<?php

	session_start();
	include('class.php');
	$data = $_POST['d'];
	/*var_dump($data);*/

 	// print_r($data);
    $arr = json_decode($data);
	echo $arr;
	if($_POST){
		$db = new DB();
		$name = $_SESSION['name'];
		$id = $_SESSION['id'];
		$abc = $db->checkAttendance($name, $id);
		echo "this is qiandao.php\n";
		$url3 = 'CheckAttendanceForStaff.php';
		$url4 = 'CheckAttendanceForManager.php';
		$db->close();
		if($_SESSION['level'] == 'staff')
			Header("Location: $url3");
		else Header("Location: $url4");
	}
	$url3 = 'CheckAttendanceForStaff.php';
	$url4 = 'CheckAttendanceForManager.php';
	if($_SESSION['level'] == 'staff')
			Header("Location: $url3");
		else Header("Location: $url4");
	
?>
